package com.epam.submenu.submenu2;

import java.util.ArrayList;
import java.util.List;

import com.epam.menu.Menu;
import com.epam.menu.MenuItem;
import com.epam.submenu.submenu2.submenu2_2.*;

public class Rank2 extends MenuItem {
	private final Menu subMenu;

	public Rank2() {
		super("Second-rank","2");
		List<MenuItem> items = new ArrayList<MenuItem>();
		items.add(new AgateMenu());
		items.add(new GagatMenu());
		items.add(new SardMenu());
		items.add(new GoBack2_2());
		subMenu = new Menu(items);
	}

	@Override
	public boolean execute() {
		System.out.println("second-rank comand");
		subMenu.run();
		return true;
	}

}
